import React from "react";
import {Routes,Route,Navigate} from 'react-router-dom'
import Login from './component/Login'
import Main  from "./component/Main";
import NotFind from './component/404';

function App() {
  
  //Navigate组件：里面有个to属性 可以改变重新执行路由跳转

return (
<Routes>
  
  <Route path="/login" element={<Login/> }/>
  <Route path="/main" element={<Main/> }/>
  <Route path="/" element={<Navigate to="/login" /> }/>
  <Route path="*" element={<NotFind />} />
</Routes>
)
}

export default App;





